﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/adminDesign.master" AutoEventWireup="true"
    CodeBehind="ProductManagement.aspx.cs" Inherits="PizzaWic.admin.ProductManagement" %>

<asp:Content ID="Content1" ContentPlaceHolderID="pageTitle" runat="server">
    Produits
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="bodyAdmin" runat="server">
    <div id="content-table-inner">
        <div id="table-content">
            <div>
                <table id="product_table">
                    <thead>
                        <tr>
                            <th class="table-header-check">
                                Détails
                            </th>
                            <th class="table-header-repeat line-left">
                                Nom
                            </th>
                            <th class="table-header-repeat line-left">
                                Type
                            </th>
                            <th class="table-header-repeat line-left">
                                Prix
                            </th>
                            <th class="table-header-options line-left">
                                Actions
                            </th>
                        </tr>
                    </thead>
                    <asp:Repeater ID="MonRepeater" runat="server" OnItemCommand="MonRepeater_ItemCommand">
                        <ItemTemplate>
                            <tr class="odd">
                                <asp:HiddenField ID="HiddenFieldrm" runat="server" Value='<%# Eval("id_product")%>' />
                                <td>
                                    <div class="arrow">
                                    </div>
                                </td>
                                <td>
                                    <%# Eval("name")%>
                                </td>
                                <td>
                                    <asp:Label ID="LabelType" runat="server" Text='<%# Eval("type")%>' />
                                </td>
                                <td>
                                    <%# Eval("price")%>
                                </td>
                                <td class="td_options">
                                    <asp:ImageButton ID="ImageButton1" runat="server" CssClass="edit" src="../images/table/action_edit.gif"
                                        title="editer" />
                                    <asp:ImageButton ID="ImageButton2" runat="server" src="../images/table/action_delete.gif"
                                        title="Supprimer" CommandName="delete_product" CommandArgument='<%# Eval("id_product") %>' />
                                    <ajaxToolkit:ModalPopupExtender ID="mpeEdit" runat="server" TargetControlID="ImageButton1"
                                        PopupControlID="panelEdit" CancelControlID="btnCancel" />
                                    <asp:Panel ID="panelEdit" runat="server" Width="400px" HorizontalAlign="Center">
                                        <div id='<%# Eval("id_product") %>' class="overlay">
                                            <table id="subTable_product">
                                                <thead>
                                                    <tr>
                                                        <th class="table-header-check">
                                                            Nom
                                                        </th>
                                                        <th class="table-header-repeat line-left">
                                                            Type
                                                        </th>
                                                        <th class="table-header-repeat line-left">
                                                            Prix (en €)
                                                        </th>
                                                        <th class="table-header-options line-left">
                                                            Composition
                                                        </th>
                                                    </tr>
                                                </thead>
                                                <tr class="simple">
                                                    <td>
                                                        <asp:TextBox ID="editName" runat="server" CssClass="inp-form" Text='<%# Eval("name")%>'></asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <asp:DropDownList CssClass="styledselect2" ID="editType" runat="server">
                                                            <asp:ListItem>Pizza</asp:ListItem>
                                                            <asp:ListItem>Boisson</asp:ListItem>
                                                            <asp:ListItem>Dessert</asp:ListItem>
                                                        </asp:DropDownList>
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="editPrice" runat="server" CssClass="inp-form" Text='<%# Eval("price")%>'> </asp:TextBox>
                                                    </td>
                                                    <td>
                                                        <ul>
                                                            <asp:Repeater ID="Repeater1" runat="server" OnItemDataBound="checkBoxChecked">
                                                                <ItemTemplate>
                                                                    <asp:HiddenField ID="HF_rawMaterial" runat="server" Value='<%# Eval("id_raw_material")%>' />
                                                                    <li style="text-align: left;">
                                                                        <asp:CheckBox ID="rawMaterialId" runat="server" />
                                                                        &nbsp;
                                                                        <%# Eval("name")%>
                                                                    </li>
                                                                </ItemTemplate>
                                                            </asp:Repeater>
                                                        </ul>
                                                    </td>
                                                </tr>
                                                <tr class="simple">
                                                    <td colspan="4">
                                                        <img src='../images/<%# Eval("picture")%>' alt="Image du produit" />
                                                        <br />
                                                        <br />
                                                        <asp:HiddenField ID="HF_file" runat="server" Value='<%# Eval("picture")%>' />
                                                        <asp:FileUpload ID="FileUpload1" CssClass="file_1" runat="server" />
                                                    </td>
                                                </tr>
                                            </table>
                                            </br> </br>
                                            <asp:Button ID="btnCancel" runat="server" Text="Annuler" />
                                            <asp:Button ID="btnEdit" runat="server" Text="Valider" CommandName="edit_product"
                                                CommandArgument='<%# Eval("id_product") %>' />
                                        </div>
                                        <div id="masque">
                                        </div>
                                    </asp:Panel>
                                </td>
                            </tr>
                            <tr style="display: none">
                                <td colspan="5">
                                    <img src='../images/<%# Eval("picture")%>' alt="Image du produit" />
                                    <div style="display: inline-block; vertical-align: top;">
                                        <h4>
                                            Composition</h4>
                                        <ul>
                                            <asp:Repeater ID="Repeater2" runat="server">
                                                <ItemTemplate>
                                                    <li>
                                                        <%# Eval("name")%>
                                                    </li>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </ul>
                                    </div>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </table>
            </div>
        </div>
        <div class="clear">
        </div>
    </div>
</asp:Content>
